/* btree_types.h */

/**
 * @file
 * This modul defines the structs and types used for a binary tree.
 *
 * @author  Kevin Wittek - 200824634
 * @date 2011-01-11
 */

#ifndef BTREE_TYPES_H
#define	BTREE_TYPES_H


/**
 * Function type for destroying nodes.
 */
typedef void (*DESTROY_FCT)(void *);

/**
 * Function type for printing node values.
 */
typedef void (*PRINT_FCT)(void *);

/**
 * Structure representing a node in a binary tree.
 */
typedef struct BTreeNode {
    unsigned char value;
    struct BTreeNode *left_child;
    struct BTreeNode *right_child;
} BTREE_NODE;

/**
 * Structure representing a binary tree.
 */
typedef struct BTree {
    int value;
    BTREE_NODE *root;
    DESTROY_FCT destroy_data;
    PRINT_FCT print_data;
} BTREE;



#endif

